package com.sitech.ibnms.c3p.util;

import com.sitech.ismp.workflow.domain.Task;
import org.apache.activemq.command.ActiveMQQueue;

import javax.jms.Queue;

/**
 * Created by liujhc on 7/20.
 */
public final class C3pConstants {
    private C3pConstants() {
    }

    public static final String IGNITE_GRID_NAME = "grid-c3p-server";

    /**
     * Agent队列名的前缀
     */
    public static final String AGENT_QUEUE_PREFIX = "Q_AGENT_";

    public static final String PARAM_C3P_TASK_ID = "task:C3P_TASK_ID";
    public static final String PARAM_EXECUTE_RESOURCE_ID = "task:RESOURCE_ID";
    public static final String PARAM_C3P_COMMAND_ID = "task:C3P_COMMAND_ID";
    public static final String PARAM_WORKFLOW_TASK = Task.class.getName();
    public static final String CONTEXT_SCHEDULE_ID = "SCHEDULE_ID";
    public static final String JOB_EXECUTION_CONTEXT = "jobExecutionContext";
    public static final String CONTEXT_ROOT_SERIAL_NO = "ROOT_SERIAL_NO";
    public static final String CONTEXT_PARENT_SERIAL_NO = "PARENT_SERIAL_NO";
    public static final String CONTEXT_PARENT_WF_TASK_ID = "PARENT_WF_TASK_ID";
    public static final String CONTEXT_SMS_NOTIFY = "CONTEXT_SMS_NOTIFY";
    public static final String CONTEXT_MAIL_NOTIFY = "CONTEXT_MAIL_NOTIFY";
    public static final int FLAG_SMS_NOTIFY = 0x1;
    public static final int FLAG_MAIL_NOTIFY = 0x2;
    public static final String FLAG_TASK_TERMINATE = "TERMINATE";
    public static final String FLAG_TASK_COMPLETE = "COMPLETE";

    public static final String OUTVAR_SQL_STATEMENT = "sql.statement";
    public static final String OUTVAR_SQL_RESULT_CONTENT = "sql.result.content";
    public static final String OUTVAR_SQL_RESULT_UNIT_ID = "sql.result.unitid";
    public static final String OUTVAR_SQL_RESULT_SIZE = "sql.result.size";
    public static final String KPI_SQL_RESULT_CONTENT = "PM-00-03-001-98";
    public static final String KPI_SQL_RESULT_SIZE = "PM-00-03-001-99";

    public static final String OUTVAR_SHELL_RESULT_CONTENT = "shell.result.content";

    public static final String KPI_SHELL_RESULT_CONTENT = "PM-01-14-013-02";

    public static final String KPI_SCRIPT_RUN_STATUS = "PM-01-15-001-01";
    public static final String KPI_RESULT_DIFF = "PM-01-15-001-02";

    public static final String PARAM_KPI_MAPPING = "KPI_MAPPING";
    public static final String PARAM_VAR_MAPPING = "VAR_MAPPING";

    //指令执行语句
    public static final String SCRIPT_CONTENT = "SCRIPT_CONTENT";

    // 执行输出参数
    public static final String CMD_OUT_PREFIX = "C3pResults:";
    public static final String CMD_OUT_EXEC_FLAG = CMD_OUT_PREFIX + "EXEC_FLAG";
    public static final String CMD_OUT_EXEC_RESULT = CMD_OUT_PREFIX + "EXEC_RESULT";
    public static final String CMD_OUT_FAILED_REASON = CMD_OUT_PREFIX + "FAILED_REASON";
    public static final String CMD_OUT_RESULT_TYPE = CMD_OUT_PREFIX + "RESULT_TYPE";
    public static final String CMD_OUT_KPIS = CMD_OUT_PREFIX + "KPIS";
    public static final String CMD_OUT_BEGIN_TIME = CMD_OUT_PREFIX + "BEGIN_TIME";
    public static final String CMD_OUT_END_TIME = CMD_OUT_PREFIX + "END_TIME";

    //执行策略
    public static final String PARAM_EXECUTE_POLICY = "HANDLEPROCESS_EXECUTE_POLICY";

    //人工节点来源
    public static final String MANUAL_TASK_FROM_FAIL = "FAIL_POLICY";
    public static final String MANUAL_TASK_FROM_EXECUTE = "EXECUTE_POLICY";

    //单节点 多执行主机 需要执行数  与执行完成数
    public static final String PARAM_RESOURCE_COUNT = "PARAM_RESOURCE_COUNT";
    public static final String PARAM_RESOURCE_COUNT_EXECUTED = "PARAM_RESOURCE_COUNT_EXECUTED";

    public static final String PARAM_COMMAND_TYPE = "PARAM_COMMAND_TYPE";

    public static final String LOCAL_PROVINCE_DICT = "214";
    public static final String SYSTEM_PARAM_DICT = "200";

    public static final String C3P_APP_NAME_DICT_VALUE = "C3P_APP_NAME";

    public static final String C3P_DEFAULT_CACHE = "C3P_CACHE_TO_DATABASE";


    /**
     * 发送appserver消息的QUEUE
     */

    public static final Queue APPSERVER_SMS_QUEUE = new ActiveMQQueue("Q_APPSERVER_SMS");
    public static final Queue APPSERVER_MAIL_QUEUE = new ActiveMQQueue("Q_APPSERVER_MAIL");

    //节点短信发送类型
    public static final String SMS_TYPE_BEFORE="BEFORE";
    public static final String SMS_TYPE_AFTER="AFTER";
    public static final String SMS_TYPE_ALL="ALL";

}
